<?php get_header();?>
<!--主要内容 -->
<div id="content-article">
	<div class="container">
		<div class="row">
			<div class="col-sm-12 col-md-8 col-lg-8 cont-left">
				<!--文章内容开始left -->
				<?php if(have_posts()): ?>
				<?php while(have_posts()):the_post();  ?>
				
				<div id="detail-article">
					<!--后台添加文章标题和作者开始 -->
					<div class="da-title">
						<h2><?php the_title_attribute(); ?></h2>
					</div>
					<div class="ad-block ad-block-title">
						<?php if (ztmao('ztmao_ad_single') != '') { ?>
						<?php echo ztmao('ztmao_ad_single_url'); ?>
						<?php } ?>
					</div>
					<div class="article-author">
					<?php  
						if( !is_category() ) {
							$category = get_the_category();
						if($category[0]){
					echo '<a href="'.get_category_link($category[0]->term_id ).'" class="column-link"># '.$category[0]->cat_name.'</a>';
						}
						};
					?>
						<span class="article-time" style="margin-left: 0px;"><?php the_date('Y-m-d H:i'); ?></span>
						<!--<?php if (ztmao('list-comment') != '') { ?>
						<span class="article-pl"><i class="iconfont icon-pinglun"></i> <?php echo get_post($post->ID)->comment_count; ?></span>
						<?php } ?>
						<?php if (ztmao('list-liulan') != '') { ?>
						<span class="article-time liulan"><i class="iconfont icon-faxian"></i> <?php post_views('',''); ?></span>
						<?php } ?>-->
						<?php   $custom_fields = get_post_custom_keys($post->ID);if (!in_array ('laiyuan_value', $custom_fields)) : ?>
						<span class="article-time">来源： <a href="<?php bloginfo('url'); ?>"><?php bloginfo('name'); ?></a></span>
		   				<?php else: ?>
	       				<?php  $custom = get_post_custom($post->ID);	$custom_value = $custom['laiyuan_value']; ?>
						来源： <a href="laiyuan/<?php echo get_post_meta($post->ID,'laiyuan_value',true);?>"><?php echo get_post_meta($post->ID,"laiyuan_value",true);?></a>
	        			<?php endif; ?>
	        			<?php edit_post_link('[编辑]'); ?>

						
					</div>
					<!--后台添加文章标题和作者结束 -->
					<!--后台添加文章信息内容开始 -->
					<div class="data-article">
						<?php the_content(); 
						ztmao_link_pages('before=<div id="page">&after=&next_or_number=next&previouspagelink=上一页&nextpagelink=');  ztmao_link_pages('before=&after='); ztmao_link_pages('before=&after=</div>&next_or_number=next&previouspagelink=&nextpagelink=下一页'); ?>
						<div class="tag-box ">
							<?php the_tags('', ' ', ''); ?>
						</div>
					</div>
					<!-- 文章结束广告位 -->
					<div class="ad-block ad-block-tags">
						<?php if (ztmao('ztmao_ad_single_article_end') != '') { ?>
							<?php echo ztmao('ztmao_ad_single_article_end_url'); ?>
						<?php } ?>
					</div>
					<!--相关文章 -->
					<?php include( 'parts/related.php' ); ?>
				</div>
				<?php endwhile;  endif; ?>
				<!--文章内容结束 -->
			</div>
			<?php get_sidebar();?>
		</div>
	</div>
</div>
<!--底部 -->
<div class="go-top0" id="gotopbtn">
	<i class="icon icon-top"></i>
</div>
<?php get_footer();?>